package com.yu.judge.codesandebox.impl;

import com.yu.judge.codesandebox.CodeSandbox;
import com.yu.judge.model.ExcuteResponse;
import com.yu.judge.model.ExecuteRequest;
import com.yu.judge.model.JudgeInfo;

import java.util.Arrays;
import java.util.List;

/**
 * 代码沙箱仅供测试使用

 */
public class ExampleCodeSandbox implements CodeSandbox {
    @Override
    public ExcuteResponse excuteCode(ExecuteRequest excuteRequest) {

        List<String> input = excuteRequest.getInput();

        ExcuteResponse excuteResponse=new ExcuteResponse();
        excuteResponse.setOutput(input);

        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setTime(100L);
        judgeInfo.setMemory(100L);
        judgeInfo.setStackLimit(100L);
        judgeInfo.setMessage("通过");

        excuteResponse.setJudgeInfo(judgeInfo);
        excuteResponse.setStatus(0);
        excuteResponse.setOutput(Arrays.asList("50","5"));

        return excuteResponse;
    }
}


